import {
  Component,
  OnInit,
} from '@angular/core';
import {
  ActivatedRoute
} from '@angular/router';
import { HttpService } from '../../../../http/http.service';

interface ICoffeeFormItem {
  option: {
    label: string,
    value: any
  };
  [propName: string]: any;
}

export interface ICoffee {
  id: string;
  name: string;
  slogen: string;
  summer: string;
  bgUrl: string;
  options: {
    type: string,
    list: Array<ICoffeeFormItem>
  };
}

@Component({
  selector: 'app-coffees',
  templateUrl: './coffees.component.html',
  styleUrls: [ './coffees.component.less' ]
})
export class CoffeesComponent implements OnInit {

  private _coffeeData: ICoffee;
  constructor(
    private http: HttpService,
  ) { }

  ngOnInit() {
    this.http.getCoffees().subscribe((data: ICoffee) => this._coffeeData = data);
  }
  test() {
    console.log('show me');
  }
}
